//
//  UserMoneyTableViewCell.m
//  huien
//
//  Created by yiban on 2017/5/27.
//  Copyright © 2017年 lcb. All rights reserved.
//

#import "UserMoneyTableViewCell.h"
@interface UserMoneyTableViewCell ()
@property(nonatomic,strong)UILabel *totalML;
@property(nonatomic,strong)UILabel *totalVML;
@property(nonatomic,strong)UILabel *ableML;
@property(nonatomic,strong)UILabel *ableVML;
@property(nonatomic,strong)UILabel *incomeML;
@property(nonatomic,strong)UILabel *incomeVML;
@property(nonatomic,strong)UIView *linev;
@end
@implementation UserMoneyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor =[UIColor clearColor];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
   
    
}
/// 根据数据模型来显示内容
- (void)showInfo:(id)model indexPath:(NSIndexPath *)indexPath
{
    self.data =model;
    self.indexPath=indexPath;
    FundlistModel *funlist = (FundlistModel*)model;
    //
    self.line.hidden=YES;
    self.totalML.frame =CGRectMake(0, 0, SCREEN_WIDTH, 30);
    self.totalVML.frame =CGRectMake(0, self.totalML.frame.origin.y+self.totalML.frame.size.height+10, SCREEN_WIDTH, 20);
    
    self.ableML.frame =CGRectMake(0, self.totalVML.frame.origin.y+self.totalVML.frame.size.height+10, SCREEN_WIDTH/2, 20);
    self.ableVML.frame =CGRectMake(0,  self.ableML.frame.origin.y+ self.ableML.frame.size.height+10, SCREEN_WIDTH/2, 20);
    
    self.linev.frame = CGRectMake(SCREEN_WIDTH/2,  self.ableML.frame.origin.y, 1, 40);
    self.incomeML.frame =CGRectMake(SCREEN_WIDTH/2, self.ableML.frame.origin.y, SCREEN_WIDTH/2, 20);
    self.incomeVML.frame =CGRectMake(SCREEN_WIDTH/2, self.ableVML.frame.origin.y, SCREEN_WIDTH/2, 20);
    for (FundsModel *fmodel in funlist.funds) {
        if (fmodel.Id ==1) {
            self.totalML.text = fmodel.name;
            self.totalVML.text = fmodel.money;
        }else if (fmodel.Id ==2) {
            self.ableML.text = fmodel.name;
            self.ableVML.text = fmodel.money;
        }else if (fmodel.Id ==3) {
            self.incomeML.text = fmodel.name;
            self.incomeVML.text = fmodel.money;
        }
    }
    
    
}
+(CGFloat)returnCellHeight
{
    return 125;
}
-(void)dealloc
{
    [LcbLog log:@"UserMoneyTableViewCell--------->dealloc"];
}
-(UIView*)linev
{
    if (!_linev) {
        _linev =[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 1)];
        _linev.backgroundColor=UIColorFromRGB(0xeff2f2);
        [self addSubview:_linev];
    }
    return _linev;
}
-(UILabel*)totalML
{
    if (!_totalML) {
        _totalML = [[UILabel alloc] initWithFrame:CGRectZero];
        _totalML.text = @"总金额（元）";
        _totalML.font = [UIFont systemFontOfSize:15];
        _totalML.textColor = h2color;
        _totalML.textAlignment = NSTextAlignmentCenter;
        _totalML.backgroundColor = [UIColor clearColor];
        [self addSubview:_totalML];
    }
    return _totalML;
}
-(UILabel*)totalVML
{
    if (!_totalVML) {
        _totalVML = [[UILabel alloc] initWithFrame:CGRectZero];
        _totalVML.text = @"0.00";
        _totalVML.font = [UIFont systemFontOfSize:15];
        _totalVML.textColor = h2color;
        _totalVML.textAlignment = NSTextAlignmentCenter;
        _totalVML.backgroundColor = [UIColor clearColor];
        [self addSubview:_totalVML];
    }
    return _totalVML;
}
-(UILabel*)ableML
{
    if (!_ableML) {
        _ableML = [[UILabel alloc] initWithFrame:CGRectZero];
        _ableML.text = @"可用余额（元）";
        _ableML.font = [UIFont systemFontOfSize:15];
        _ableML.textColor = h2color;
        _ableML.textAlignment = NSTextAlignmentCenter;
        _ableML.backgroundColor = [UIColor clearColor];
        [self addSubview:_ableML];
    }
    return _ableML;
}
-(UILabel*)ableVML
{
    if (!_ableVML) {
        _ableVML = [[UILabel alloc] initWithFrame:CGRectZero];
        _ableVML.text = @"0.00";
        _ableVML.font = [UIFont systemFontOfSize:15];
        _ableVML.textColor = h2color;
        _ableVML.textAlignment = NSTextAlignmentCenter;
        _ableVML.backgroundColor = [UIColor clearColor];
        [self addSubview:_ableVML];
    }
    return _ableVML;
}
-(UILabel*)incomeML
{
    if (!_incomeML) {
        _incomeML = [[UILabel alloc] initWithFrame:CGRectZero];
        _incomeML.text = @"累计收益（元）";
        _incomeML.font = [UIFont systemFontOfSize:15];
        _incomeML.textColor = h2color;
        _incomeML.textAlignment = NSTextAlignmentCenter;
        _incomeML.backgroundColor = [UIColor clearColor];
        [self addSubview:_incomeML];
    }
    return _incomeML;
}
-(UILabel*)incomeVML
{
    if (!_incomeVML) {
        _incomeVML = [[UILabel alloc] initWithFrame:CGRectZero];
        _incomeVML.text = @"0";
        _incomeVML.font = [UIFont systemFontOfSize:15];
        _incomeVML.textColor = h2color;
        _incomeVML.textAlignment = NSTextAlignmentCenter;
        _incomeVML.backgroundColor = [UIColor clearColor];
        [self addSubview:_incomeVML];
    }
    return _incomeVML;
}


@end
